package be.ipl.eBar.daoimpl;

import javax.ejb.Stateful;
import javax.ejb.TransactionAttribute;
import javax.ejb.TransactionAttributeType;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.persistence.PersistenceContextType;

import be.ipl.eBar.dao.UneCommandeDao;
import be.ipl.eBar.domaine.Commande;

@Stateful
@TransactionAttribute(TransactionAttributeType.SUPPORTS)
public class UneCommandeDaoImpl implements UneCommandeDao {

	@PersistenceContext(name = "eBar", type = PersistenceContextType.EXTENDED)
	private EntityManager entityManager;

	@Override
	public Commande enregistrer(Commande commande) {
		entityManager.persist(commande);
		return commande;
	}

}
